package com.leecode.xiehf.page_06;

import com.leecode.Printer;
import com.leecode.xiehf.page_02.Solution_0065;

public class Solution_0263 extends Printer {

    public static void main(String[] args) {
        Solution_0263 solution = new Solution_0263();
        boolean number = solution.isUgly(8);
        System.out.println(number);
    }

    public boolean isUgly(int n) {
        if (n < 1) {
            return false;
        }
        while (n % 2 == 0) {
            n = n / 2;
        }
        while (n % 3 == 0) {
            n = n / 3;
        }
        while (n % 5 == 0) {
            n = n / 5;
        }
        return n == 1;
    }
}
